import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: { title: '登录'}
  },
  {
    path: '/home',
    name: 'Home',
    // component: () => import('@/views/home/index.vue'),
    component: () => import('@/layout/index.vue'),
    redirect: '/info',
    children: [
      {
        path: '/info',
        name: 'Info',
        component: () => import('@/views/Info'),
        meta: { title: 'Redis信息'}
      },
      {
        path: '/admin-key',
        component: () => import('@/views/AdminKey/index.vue'),
        name: 'AdminKey',
        meta: { title: '管理key'}
      },
      {
        path: '/pub-sub',
        component: () => import('@/views/PubSub/index.vue'),
        name: 'PubSub',
        meta: { title: '发布订阅'}
      },
      {
        path: '/about',
        name: 'About',
        component: () => import('@/views/About'),
        meta: { title: '关于(yy祝)'}
      },
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
